$(document).ready(function(){
	var validator = $("#frmAddState").validate({
		
		errorElement:'div',
		rules: {
			country: {
				required: true
			},
			statename: {
				required: true,
				character:true/*,
				remote:SITEROOT+'/admin/state/checkstateexist.php'*/
			},
			siso_code: {
				required: true,
				//character:true,
				maxlength: 10
			}		
		},
		messages: {
			country: {
				required: "Please Select Country"
			},
			statename: {
				required: "Please enter state name ",
				character: "Please enter characters only"/*,
				remote: jQuery.format("State name already in use")*/
			},
			siso_code: {
				required: "Please enter iso code ",
				//character: "Please enter characters only",
				maxlength: jQuery.format("Enter at most {0} characters")
			}
		}	
		});	
	
	var validator = $("#frmEditState").validate({
		
		errorElement:'div',
		rules: {
			country: {
				required: true
			},
			statename: {
				required: true,
				character:true/*,
				remote:SITEROOT+'/admin/checkstateexist.php?id='+$("#stateId").val()*/
			},
			siso_code: {
				required: true,
				//character:true,
				maxlength: 10
			}			
		},
		messages: {
			country: {
				required: "Select Country"
			},
			statename: {
				required: "Please enter state name",
				character: "Please enter characters only"/*,
				remote: jQuery.format("State name already in use")*/
			},
			siso_code: {
				required: "Please enter state area code ",
				//character: "Please enter characters only",
				maxlength: jQuery.format("Enter at most {0} characters")
			}
		}
	
		});
		
		var validator = $("#frmEditPostcode").validate({
		
		errorElement:'div',
		rules: {			
			suburbname: {
				required: true,
				character:true/*,
				remote:SITEROOT+'/admin/checkstateexist.php?id='+$("#stateId").val()*/
			},
			postcode: {
				required: true,
				number:true,
				maxlength: 4
			}			
		},
		messages: {			
			suburbname: {
				required: "Please enter suburb name",
				character: "Please enter characters only"/*,
				remote: jQuery.format("State name already in use")*/
			},
			postcode: {
				required: "Please enter postal code ",
				number: "Please enter numbers only",
				maxlength: jQuery.format("Enter at most {0} characters")
			}
		}
	
		});
	
	
});
